Unit RprTempEntry;

Interface

Uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, ADODB, FormClass,  StdCtrls, Wwdbcomb, wwdbedit, Mask, Wwdotdot,
  wwdblook, wwdbdatetimepicker, wwidlg, ExtCtrls, fcStatusBar, ActnList,
  XPMan, StdActns;

Type
  TfmRprTempEntry = Class(TfmFormClass)
    pnlKriter : TPanel;
    Bevel5 : TBevel;
    Bevel6 : TBevel;
    Bevel7 : TBevel;
    Bevel8 : TBevel;
    Bevel1 : TBevel;
    lblKriterBaslik2 : TLabel;
    lblKriterBaslik1 : TLabel;
    lblRaporName : TLabel;
    cbRaporName : TwwDBComboBox;
    edRaporBasligi : TwwDBEdit;
    lblRaporBasligi : TLabel;
    btRapor : TButton;
    btKapat : TButton;
    aqMusteOzelkod1 : TADOQuery;
    fcStatusBar1 : TfcStatusBar;
    paKriter2 : TPanel;
    paKriter21 : TPanel;
    paKriter22 : TPanel;
    paKriter23 : TPanel;
    paKriter24 : TPanel;
    paKriter25 : TPanel;
    paKriter26 : TPanel;
    paKriter27 : TPanel;
    paKriter28 : TPanel;
    paKriter29 : TPanel;
    paKriter210 : TPanel;
    Bevel2 : TBevel;
    Bevel3 : TBevel;
    Bevel4 : TBevel;
    Bevel9 : TBevel;
    Bevel10 : TBevel;
    Bevel11 : TBevel;
    Bevel12 : TBevel;
    Bevel13 : TBevel;
    Bevel14 : TBevel;
    Bevel15 : TBevel;
    Bevel16 : TBevel;
    Bevel17 : TBevel;
    Bevel18 : TBevel;
    Bevel19 : TBevel;
    Bevel20 : TBevel;
    Bevel21 : TBevel;
    Bevel22 : TBevel;
    Bevel23 : TBevel;
    Bevel24 : TBevel;
    Bevel25 : TBevel;
    Bevel26 : TBevel;
    Bevel27 : TBevel;
    paKriter214 : TPanel;
    Bevel28 : TBevel;
    Bevel29 : TBevel;
    paKriter213 : TPanel;
    Bevel30 : TBevel;
    Bevel31 : TBevel;
    paKriter212 : TPanel;
    Bevel32 : TBevel;
    Bevel33 : TBevel;
    paKriter211 : TPanel;
    Bevel34 : TBevel;
    Bevel35 : TBevel;
    paKriter215 : TPanel;
    Bevel36 : TBevel;
    Bevel37 : TBevel;
    paKriter216 : TPanel;
    Bevel38 : TBevel;
    Bevel39 : TBevel;
    Bevel40 : TBevel;
    Bevel41 : TBevel;

    Procedure btKapatClick(Sender : TObject);
    Procedure FormCreate(Sender : TObject);
    Procedure cbRaporNameEnter(Sender : TObject);
  Private
    { Private declarations }
  Public
    { Public declarations }
    ParamsStyle : TVariantList;

    //    constructor Create(AOwner: TComponent; gFormStyle : TFormStyle = fsMDIChild; gCaption : String = ''; gParamsStyle : TParameter = nil);
  End;

Var
  fmRprTempEntry : TfmRprTempEntry;

Implementation

Uses data, UnitOrtak;

{$R *.dfm}


Procedure TfmRprTempEntry.btKapatClick(Sender : TObject);
Begin
  Close;
End;

Procedure TfmRprTempEntry.FormCreate(Sender : TObject);
Begin
  If RaporName Then
  Begin
    cbRaporName.Visible := Assigned(FindComponent('cbRaporGrupTipi'));
    lblRaporName.Visible := cbRaporName.Visible;
  End
  Else
  Begin
    cbRaporName.Visible := RaporName;
    lblRaporName.Visible := RaporName;
  End;
  OpenQueryOnDataSet('Select GetDate(), "" as OzelKod', aqMusteOzelkod1);

  //  select * from VIEW_KRMUSTE_OZELKOD1
  //  if not aqMusteOzelkod1.Active then aqMusteOzelkod1.Open;
End;

Procedure TfmRprTempEntry.cbRaporNameEnter(Sender : TObject);
Var
  QSql : String;
  RtmName : String;
Begin
  If Not Assigned(FindComponent('cbRaporGrupTipi')) Then
    Exit;

  If (FindComponent('cbRaporGrupTipi') As TwwDBComboBox).Text <> '999' Then
    RtmName := (FindComponent('cbRaporTipi') As TwwDBComboBox).Value
  Else
    RtmName := (FindComponent('cbRaporGrupTipi') As TwwDBComboBox).Value;

  QSql := 'Select * from rapordizaynadi where personelkodu = ' + PersonelID + ' ';
  QSql := QSql + 'and formadi = ''' + Self.Caption + ''' and raporadi = ''' + RtmName + ''' ';
  OpenQueryOnDataSet(QSql, DM.aqActive);

  cbRaporName.Items.Clear;
  If DM.aqActive.RecordCount = 0 Then
    cbRaporName.Text := '';

  cbRaporName.Items.Add('' + #9 + '');
  DM.aqActive.First;
  While Not DM.aqActive.Eof Do
  Begin
    cbRaporName.Items.Add(DM.aqActive.FieldByName('firmaadi').AsString + ' ' + DM.aqActive.FieldByName('aciklama').AsString + ' [' + DM.aqActive.FieldByName('firmaraporadi').AsString + ']' + #9 + DM.aqActive.FieldByName('firmaraporadi').AsString);
    DM.aqActive.Next;
  End;
  cbRaporName.ItemIndex := 0;
End;

End.
